<?php

require_once 'phpmailer/class.phpmailer.php';
class system_mail extends PHPMailer{
    public $CharSet = "utf-8";
    public $ContentType       = 'text/html';
    public $From              = 'phuc@slopetracker.no';
    public $FromName          = 'Likewinn';
    
    public function __construct($exceptions = false) {
        parent::__construct($exceptions);
        $this->IsSMTP();
        $this->SMTPAuth   = true;  
        $this->Host = "email-smtp.us-east-1.amazonaws.com";
        $this->Port = 25;
        $this->Username = "AKIAJTB42AZQRP62BNHA";
        $this->Password = "Ak3m/ploX3xYMKxKEYWj1moHylq8+P3ZsyT6K2kS6Zjf";
        $this->IsHTML(true);
        $this->SMTPSecure = 'tls';
    }
    
    public function test()
    {
        $this->SetFrom("phuc@slopetracker.no", "Phuc");
        $this->AddAddress("phamhphuc.bk@gmail.com", "Phuc");
        $this->Subject = "Test email";
        $this->MsgHTML("This is text html");
        //Success
        if ($this->Send()) {
            echo "Message sent!";
        } else {
            echo "Mailer Error: " . $this->ErrorInfo;
        }
    }
}